import fetch from 'utils/fetch';
/**
 * 查询渠道
 */
export function getChannels() {
  return fetch({
    url: '/api/admin/loanOrderApplyTown/getChannels',
    method: 'get'
  });
}
/**
 * 查询客服接⼝
 * @param {Object} data
 */
export function getCustomer(data) {
  return fetch({
    url: '/api/admin/base/user/find/custom/list',
    method: 'post',
    data
  });
}
/**
 * 查询客服组
 * @param {String} channel
 */
export function getCustomerGroup(channel) {
  return fetch({
    url: '/api/admin/base/user/find/custom/group/list',
    method: 'post',
    data: {
      channel
    }
  })
}
/**
 * 指派订单
 * @param {String} customId 客服员id
 * @param {String} customName 客服员姓名
 * @param {Array} cashoutCusviceIds 放款回访记录id集合
 */
export function sendOrder(customId, customName, cashoutCusviceIds) {
  return fetch({
    url: '/api/admin/cashout/cusvice/designate/order',
    method: 'put',
    data: {
      customId,
      customName,
      cashoutCusviceIds
    }
  })
}
/**
 * 已分配订单-近期数据
 */
export function rencentAmount() {
  return fetch({
    url: '/api/admin/cashout/cusvice/recent/amount',
    method: 'post'
  })
}
/**
 * 待分配订单 & 已分配订单-分⻚页查询
 * @param {Object} data 请求参数
 */
export function page(data) {
  return fetch({
    url: '/api/admin/cashout/cusvice/find/page',
    method: 'post',
    data
  });
}